package com.fiap.conversaoEJB.ejb;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

import com.fiap.interfaces.IServiceLocal;
import com.fiap.interfaces.IServiceRemote;

@Stateless
@WebService
public class ServiceBean implements IServiceLocal, IServiceRemote {

	public ServiceBean() {

	}

	@WebMethod(operationName="ConverterCelsiusToFarenheit")
	@WebResult(name="retorno")
	public float celsiusToFarenheit(@WebParam(name="grausCelsius") float celsius) {
		
		float farenheit = 0;
		
		farenheit = celsius*1.8F+32;

		System.out.println("metodo celsiusToFarenheit acionado");
		return farenheit;
	
	}

	@WebMethod(operationName="ConverterFarenheitToCelsius")
	@WebResult(name="retorno")
	public float farenheitToCelsius(@WebParam(name="grausFarenheit") float farenheit) {
		float celsius = 0;
		celsius = (farenheit-32)/1.8F;
		System.out.println("metodo farenheitToCelsius acionado");
		return celsius;
	}

}
